package guowei.gulistorage.storage.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.rabbitmq.client.Channel;
import guowei.common.to.es.WareSkuIdStocks;
import guowei.common.to.mq.OrderVo;
import guowei.common.to.mq.StockLockedTo;
import guowei.common.utils.PageUtils;
import guowei.gulistorage.storage.entity.WareSkuEntity;
import guowei.gulistorage.storage.vo.*;
import org.springframework.amqp.core.Message;

import java.util.List;
import java.util.Map;

/**
 * 商品库存
 *
 * @author guoguo
 * @email 1573746397@qq.com
 * @date 2023-05-21 12:24:20
 */
public interface WareSkuService extends IService<WareSkuEntity> {

    PageUtils queryPage(Map<String, Object> params);

    List<WareSkuIdStocks> getAllStorages(List<Long> skuIds);

    List<StockHasVo> getInfoBuSkuIds(List<Long> ids);

    AddressAndFareVo getfareId(Long addrId);

    Boolean tryLockItems(OrderStorageLockVo lockVo);

    void listenStock(StockLockedTo stockLockedTo, Message message, Channel channel);

    void unlockStock(OrderVo orderVo);
}

